USE [GESTION2]
GO

 -- creating the store procedure
IF EXISTS (SELECT name 
	   FROM   sysobjects 
	   WHERE  name = 'WASP_D0002_CREA_TABLA_CRSEGUROS'
	   AND 	  type = 'P')
    DROP PROCEDURE [dbo].[WASP_D0002_CREA_TABLA_CRSEGUROS]
GO

CREATE PROCEDURE [dbo].[WASP_D0002_CREA_TABLA_CRSEGUROS]
AS

if exists (select * from dbo.sysobjects where id = object_id(N'[crseguros]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [crseguros]

select * into dbo.crseguros from seguro_vida_tra union select * from seguro_asisten_pen


GO
